<template>
  <div id="bar">
      Clicked: {{ count}} times, count is {{ evenOrOdd }}.
      <button @click="increment()">+</button>
      <button @click="decrement">-</button>
      <button @click="incrementIfOdd">Increment if odd</button>
      <button @click="incrementAsync">Increment async</button>
  </div>
</template>

<script>
    import {store} from 'src/store/store';
    import { mapMutations } from 'vuex'
    import { mapActions } from 'vuex'
    import { mapGetters } from 'vuex'
    export default {
        name:'bar',

        data() {
            return {

            }
        },

        store,

        methods:{
            add() {
                console.log('test');
            },

            ...mapActions([
                'increment',
                'decrement',
                'incrementIfOdd',
                'incrementAsync'
            ])
        },

        computed:{
            count() {
                return this.$store.state.Add.count;
            },

            ...mapGetters([
                'evenOrOdd'
            ])
        },

        created(){

        }
    }

</script>
